<?php

namespace App\Enums;
//礼物
class GiftEnum {
    //所有关系类型
    const ALL_CONNECT_TYPE = [
        self::TYPE_CP_COMMON,
        self::TYPE_CP_SHOW,
        self::TYPE_CP_SHOW_GIFT,
        self::TYPE_STUDENT_SHOW,
        self::TYPE_STUDENT_SHOW_GIFT,
        self::TYPE_FRIEND_COMMON,
        self::TYPE_FRIEND_SHOW,
        self::TYPE_FRIEND_SHOW_GIFT,
        self::TYPE_CONNECT_CARD_STUDENT,
        self::TYPE_CONNECT_CARD_FRIEND,
    ];
    //绑定信物类型
    const APPLY_CONNECT_TYPE = [
        self::TYPE_CP_COMMON,
        self::TYPE_CP_SHOW,
        self::TYPE_CP_SHOW_GIFT,
        self::TYPE_STUDENT_COMMON,
        self::TYPE_STUDENT_SHOW,
        self::TYPE_STUDENT_SHOW_GIFT,
        self::TYPE_FRIEND_COMMON,
        self::TYPE_FRIEND_SHOW,
        self::TYPE_FRIEND_SHOW_GIFT,
    ];
    //CP信物类型
    const CP_CONNECT_TYPE = [
        self::TYPE_CP_COMMON,
        self::TYPE_CP_SHOW,
        self::TYPE_CP_SHOW_GIFT,
    ];
    //师徒信物类型
    const STUDENT_CONNECT_TYPE = [
        self::TYPE_STUDENT_COMMON,
        self::TYPE_STUDENT_SHOW,
        self::TYPE_STUDENT_SHOW_GIFT,
    ];
    //密友信物类型
    const FRIEND_CONNECT_TYPE = [
        self::TYPE_FRIEND_COMMON,
        self::TYPE_FRIEND_SHOW,
        self::TYPE_FRIEND_SHOW_GIFT,
    ];
    
    //关系卡类型
    const CARD_CONNECT_TYPE = [
        self::TYPE_CONNECT_CARD_STUDENT,
        self::TYPE_CONNECT_CARD_FRIEND,
    ];
    
    const TYPE_TO_LEVEL =[
        self::TYPE_CP_COMMON => 1,
        self::TYPE_CP_SHOW => 2,
        self::TYPE_CP_SHOW_GIFT => 3,
        self::TYPE_STUDENT_COMMON => 1,
        self::TYPE_STUDENT_SHOW => 2,
        self::TYPE_STUDENT_SHOW_GIFT => 3,
        self::TYPE_FRIEND_COMMON => 1,
        self::TYPE_FRIEND_SHOW => 2,
        self::TYPE_FRIEND_SHOW_GIFT => 3,
    ];
    
    const RANK_CP_TO_CHAT_MSG = [
        '1_1' => [
            'msg' => '一见钟情，结为cp关系，真是羡煞旁人~'
        ],
        '1_2' => [
            'msg' => '心心相印，结为cp关系，真是羡煞旁人~'
        ],
        '1_3' => [
            'msg' => '情比金坚，结为cp关系，真是羡煞旁人~'
        ],
        '2_1' => [
            'msg' => '一见如故，结为师徒关系，真是羡煞旁人~'
        ],
        '2_2' => [
            'msg' => '肝胆相照，结为师徒关系，真是羡煞旁人~'
        ],
        '2_3' => [
            'msg' => '深情厚谊，结为师徒关系，真是羡煞旁人~'
        ],
        '3_1' => [
            'msg' => '形影不离，结为密友关系，真是羡煞旁人~'
        ],
        '3_2' => [
            'msg' => '志同道合，结为密友关系，真是羡煞旁人~'
        ],
        '3_3' => [
            'msg' => '情深似海，结为密友关系，真是羡煞旁人~'
        ],
    ];
    
    const GIFT_BOX_BIND_GIFT = [
        self::TYPE_CP_SHOW,
        self::TYPE_CP_SHOW_GIFT,
        self::TYPE_STUDENT_SHOW,
        self::TYPE_STUDENT_SHOW_GIFT,
        self::TYPE_FRIEND_SHOW,
        self::TYPE_FRIEND_SHOW_GIFT,
    ];
    
    const CP = 20; //cp
    const STUDENT = 21; //师徒
    const FRIEND = 22;//密友+无特殊奖励
    const STUDENT_EXT_CARD = 23;   //师徒扩展卡
    const FRIEND_EXT_CARD = 24;   //密友扩展卡
    
    const TYPE_CP_COMMON = 20;  //cp+无特殊奖励
    const TYPE_CP_SHOW = 20;    //cp+个性装扮
    const TYPE_CP_SHOW_GIFT  = 20;//cp+装扮+礼物
    const TYPE_STUDENT_COMMON = 21; //师徒+无特殊奖励
    const TYPE_STUDENT_SHOW = 21; //师徒+个性装扮
    const TYPE_STUDENT_SHOW_GIFT = 21; //师徒+装扮+礼物
    const TYPE_FRIEND_COMMON = 22;//密友+无特殊奖励
    const TYPE_FRIEND_SHOW = 22;//密友+个性装扮
    const TYPE_FRIEND_SHOW_GIFT = 22;//密友+装扮+礼物
    const TYPE_CONNECT_CARD_STUDENT = 23;   //师徒扩展卡
    const TYPE_CONNECT_CARD_FRIEND = 24;   //密友扩展卡

    const SQUID_GIFT_TYPE = 10; //乌贼
    const BROKEN_SCREEN_GIFT_TYPE = 11; //碎屏

    //礼物op_type
    const DAY_TITLE_GIFT_TYPE = 14; //日冠名
    const WEEK_TITLE_GIFT_TYPE = 15; //周冠名
    const MONTH_TITLE_GIFT_TYPE = 16; //月冠名

    // 接受特效为用户的礼物
    const SPECIAL_TARGET_USER_GIFT = [
        self::SQUID_GIFT_TYPE,
        self::BROKEN_SCREEN_GIFT_TYPE,
    ];

    static public function getSpecialTarget($giftOpType)
    {
        if(in_array($giftOpType, self::SPECIAL_TARGET_USER_GIFT)){
            return 'user';
        }
        return 'room';
    }

    //冠名颜色  渐变色
    const TITLE_GIFT_COLOR = [
        self::DAY_TITLE_GIFT_TYPE   => ['#5975FF', '#59F1FF', '#73FFB9'],
        self::WEEK_TITLE_GIFT_TYPE  => ['#B580FF', '#FF8CD9', '#59FFFF'],
        self::MONTH_TITLE_GIFT_TYPE => ['#FF80D4', '#FFF480', '#FF9580'],
    ];
}
